# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLimits do
  @moduledoc """
  Label constraints governing the structure of a Label; such as, the maximum number of Fields allowed and maximum length of the label title.

  ## Attributes

  *   `fieldLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits.t`, *default:* `nil`) - The limits for Fields.
  *   `maxDeletedFields` (*type:* `integer()`, *default:* `nil`) - The maximum number of published Fields that can be deleted.
  *   `maxDescriptionLength` (*type:* `integer()`, *default:* `nil`) - The maximum number of characters allowed for the description.
  *   `maxDraftRevisions` (*type:* `integer()`, *default:* `nil`) - The maximum number of draft revisions that will be kept before deleting old drafts.
  *   `maxFields` (*type:* `integer()`, *default:* `nil`) - The maximum number of Fields allowed within the label.
  *   `maxTitleLength` (*type:* `integer()`, *default:* `nil`) - The maximum number of characters allowed for the title.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Resource name.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :fieldLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits.t() | nil,
          :maxDeletedFields => integer() | nil,
          :maxDescriptionLength => integer() | nil,
          :maxDraftRevisions => integer() | nil,
          :maxFields => integer() | nil,
          :maxTitleLength => integer() | nil,
          :name => String.t() | nil
        }

  field(:fieldLimits, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits)
  field(:maxDeletedFields)
  field(:maxDescriptionLength)
  field(:maxDraftRevisions)
  field(:maxFields)
  field(:maxTitleLength)
  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLimits do
  def decode(value, options) do
    GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLimits.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLimits do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
